//
//  TCLYWalletTableViewCell.m
//  YuErmuYing
//
//  Created by LYang on 16/9/26.
//  Copyright © 2016年 Tiancheng. All rights reserved.
//

#import "TCLYWalletTableViewCell.h"
#import "Masonry.h"
#import "Macros.h"

@implementation TCLYWalletTableViewCell
-(instancetype) initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
        UIImageView * bgImageView = [[UIImageView alloc] init];
        bgImageView.backgroundColor = bgColor;
        [self addSubview:bgImageView];
        [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self);
            make.left.mas_equalTo(self);
            make.right.mas_equalTo(self);
            make.bottom.mas_equalTo(self);
        }];
        
        self.typeLabel = [[UILabel alloc] init];
        self.typeLabel.textAlignment = NSTextAlignmentCenter;
        self.typeLabel.font = [UIFont systemFontOfSize:14];
        self.typeLabel.textColor = blackFont;
        [self addSubview:self.typeLabel];
        [self.typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_top).offset(6);
            make.left.mas_equalTo(12);
            make.width.mas_equalTo(60);
            make.height.mas_equalTo(20);
        }];
        
        self.moneyLabel = [[UILabel alloc] init];
        self.moneyLabel.textAlignment = NSTextAlignmentCenter;
        self.moneyLabel.font = [UIFont boldSystemFontOfSize:14];
        self.moneyLabel.textColor = blackFont;
        [self addSubview:self.moneyLabel];
        [self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.typeLabel);
            make.right.mas_equalTo(self.mas_right).offset(-12);
            make.left.mas_equalTo(self.typeLabel.mas_right);
            make.height.mas_equalTo(20);
        }];
        
        self.timeLabel = [[UILabel alloc] init];
        self.timeLabel.textAlignment = NSTextAlignmentLeft;
        self.timeLabel.textColor = blackFont;
        self.timeLabel.font = [UIFont systemFontOfSize:12];
        [self addSubview:self.timeLabel];
        [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.typeLabel.mas_bottom).offset(10);
            make.left.mas_equalTo(self.typeLabel);
            make.right.mas_equalTo(self.moneyLabel);
            make.height.mas_equalTo(20);
        }];
    }
    return self;
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
